<?php

class Ddup_Featured_Block_Adminhtml_Products_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
	public function __construct()
    {
        parent::__construct();
        $this->_objectId = 'id';
        $this->_blockGroup = 'featured';
        $this->_controller = 'adminhtml_products';

        $this->_updateButton('save', 'label', Mage::helper('featured')->__('Save Products Group'));
        $this->_updateButton('delete', 'label', Mage::helper('featured')->__('Delete Products Group'));

        if( $this->getRequest()->getParam($this->_objectId) ) {
            $productsGroupData = Mage::getModel('featured/products')
                ->load($this->getRequest()->getParam($this->_objectId));
            Mage::register('products_group_data', $productsGroupData);
        }
    }

    public function getHeaderText()
    {
        if( Mage::registry('products_group_data') && Mage::registry('products_group_data')->getId() ) {
            return Mage::helper('featured')->__('Edit Products Group');
        } else {
            return Mage::helper('featured')->__('New Products Group');
        }
    }
}